<?php
namespace BP\Sys;
abstract class EventBase {
	public $HisEn;	// Entity
	protected $_SysPara;	// Row
	public $SucessInfo;	// String
	protected $_title;	// String
	private function __init() { // default class members
		$this->HisEn = NULL;
		$this->_SysPara = NULL;
		$this->SucessInfo = NULL;
		$this->_title = NULL;
	}
	public function getSysPara () 
	{
		if (($this->_SysPara == NULL))
		{
			$this->_SysPara = new Row();
		}
		return $this->_SysPara;
	}
	public function setSysPara ($value) // [Row value]
	{
		$this->_SysPara = $value;
	}
	public function getTitle () 
	{
		if (($this->_title . NULL))
		{
			$this->_title = "未命�?";
		}
		return $this->_title;
	}
	public function setTitle ($value) // [String value]
	{
		$this->_title = $value;
	}
	public function getFK_Mapdata () 
	{
		return $this->GetValStr("FK_MapData");
	}
	public function getEventType () 
	{
		return $this->GetValStr("EventType");
	}
	public function getOID () 
	{
		return $this->GetValInt("OID");
	}
	public function getWorkID () 
	{
		if (($this->getOID() == 0))
		{
			return $this->GetValInt64("WorkID");
		}
		return $this->getOID();
	}
	public function getFID () 
	{
		return $this->GetValInt64("FID");
	}
	public function getFK_Flow () 
	{
		return $this->GetValStr("FK_Flow");
	}
	public function getFK_Node () 
	{
		try 
		{
			return $this->GetValInt("FK_Node");
		}
		catch (\Exception $e)
		{
			return 0;
		}
	}
	public function getWorkIDs () 
	{
		return $this->GetValStr("WorkIDs");
	}
	public function getNos () 
	{
		return $this->GetValStr("Nos");
	}
	public function GetValDateTime ($key) // [String key]
	{
		$str = $this->getSysPara()->GetValByKey($key);
		return $DataType->ParseSysDateTime2DateTime($str);
	}
	public function GetValStr ($key) // [String key]
	{
		return $this->getSysPara()->GetValByKey($key);
	}
	public function GetValInt64 ($key) // [String key]
	{
		return $Long->parseLong($this->GetValStr($key));
	}
	public function GetValInt ($key) // [String key]
	{
		return $Integer->parseInt($this->GetValStr($key));
	}
	public static function constructor__ () 
	{
		$me = new self();
		$me->__init();
		return $me;
	}
	abstract function Do (); 
	public function GetLastActionTrackID () 
	{
		$sql = (((((("SELECT  MyPK FROM ND" . $Integer->parseInt($this->getFK_Flow())) . "Track WHERE WorkID=") . $this->getWorkID()) . " AND NDFrom=") . $this->getFK_Node()) . " ORDER BY RDT ");
		$dt =DBAccess->RunSQLReturnTable($sql);
		if (($dt->Rows->size() == 0))
		{
			return NULL;
		}
		return $dt->Rows->get(0)->getValue(0);
	}
}
?>
